<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>模型管理</title>
    <meta name="author" content="SuggeElson"/>
    <meta name="description"
          content="Ycode admin template - new premium responsive admin template. This template is designed to help you build the site administration without losing valuable time.Template contains all the important functions which must have one backend system.Build on great twitter boostrap framework"/>
    <meta name="keywords"
          content="admin, admin template, admin theme, responsive, responsive admin, responsive admin template, responsive theme, themeforest, 960 grid system, grid, grid theme, liquid, masonry, jquery, administration, administration template, administration theme, mobile, touch , responsive layout, boostrap, twitter boostrap"/>
    <meta name="application-name" content="Ycode admin template"/>

    <!-- Mobile Specific Metas -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>

    <!-- Core stylesheets do not remove -->
    <link th:href="@{/lib/css/bootstrap/bootstrap.min.css}" rel="stylesheet" type="text/css"/>
    <link th:href="@{/lib/css/bootstrap/bootstrap-responsive.min.css}" rel="stylesheet" type="text/css"/>
    <link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css" rel="stylesheet">
    <link th:href="@{/lib/css/supr-theme/jquery.ui.supr.css}" rel="stylesheet" type="text/css"/>
    <link th:href="@{/lib/css/icons.css}" rel="stylesheet" type="text/css"/>

    <!-- Plugin stylesheets -->
    <link th:href="@{/lib/plugins/misc/qtip/jquery.qtip.css}" rel="stylesheet" type="text/css"/>
    <link th:href="@{/lib/plugins/forms/uniform/uniform.default.css}" type="text/css" rel="stylesheet"/>
    <link th:href="@{/lib/plugins/tables/dataTables/jquery.dataTables.css}" type="text/css" rel="stylesheet"/>

    <!-- Main stylesheets -->
    <link th:href="@{/lib/css/main.css}" rel="stylesheet" type="text/css"/>

    <!-- Custom stylesheets ( Put your own changes here ) -->
    <link th:href="@{/lib/css/custom.css}" rel="stylesheet" type="text/css"/>
    <!--<link th:href="@{/css/main.css}" rel="stylesheet" type="text/css"/>-->

    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

    <!-- Le fav and touch icons -->
    <link rel="shortcut icon" th:href="@{/lib/images/favicon.ico}"/>
    <link rel="apple-touch-icon-precomposed" sizes="144x144"
          th:href="@{/lib/images/apple-touch-icon-144-precomposed.png}"/>
    <link rel="apple-touch-icon-precomposed" sizes="114x114"
          th:href="@{/lib/images/apple-touch-icon-114-precomposed.png}"/>
    <link rel="apple-touch-icon-precomposed" sizes="72x72"
          th:href="@{/lib/images/apple-touch-icon-72-precomposed.png}"/>
    <link rel="apple-touch-icon-precomposed" th:href="@{/lib/images/apple-touch-icon-57-precomposed.png}"/>

    <script type="text/javascript">
        //adding load class to body and hide page
        document.documentElement.className += 'loadstate';
    </script>

</head>

<body>
<!-- loading animation -->
<div id="qLoverlay"></div>
<div id="qLbar"></div>
<div th:replace="fragments/header :: header"></div>

<div id="wrapper">
    <div th:replace="fragments/siderBar :: siderBar"></div>
    <!--Body content-->
    <div id="content" class="clearfix">
        <div class="contentwrapper"><!--Content wrapper-->

            <div class="heading">

                <h3>模型管理</h3>

            </div><!-- End .heading-->

            <div class="row-fluid">

                <div class="span12">

                    <div class="box gradient p-rel">

                        <div class="add-style">
                            <button class="query-btn fl" id="searchBtn" type="button">查询</button>
                        </div>

                        <div class="title">
                            <h4>
                                <span>模型列表</span>
                            </h4>
                        </div>
                        <div class="content noPad clearfix">

                            <table class="attr-table mt20">
                                <input id="areaId" type="hidden" value="440100">
                                <tbody>
                                <tr>
                                    <td>
                                        <label class="control-label">模型名称:</label>
                                        <input id="modelName" type="text">
                                    </td>
                                    <td>
                                        <label class="control-label">状态:</label>
                                        <div class="dropdown-select fl">
                                            <input class="dropdown-toggle" data-toggle="dropdown" id="status"
                                                   readonly="" type="text" value="全部"><span class="caret"></span>
                                            <ul aria-labelledby="dropdownMenu" class="dropdown-menu" id="statusList"
                                                role="menu">
                                                <li data=""><a href="#" tabindex="-1">全部</a></li>
                                                <li data="10001"><a href="#" tabindex="-1">已提交</a></li>
                                                <li data="10002"><a href="#" tabindex="-1">已发布</a></li>
                                                <li data="10003"><a href="#" tabindex="-1">审核中</a></li>
                                            </ul>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <label class="control-label">
                                            行业:
                                        </label>
                                        <div class="dropdown-select fl">
                                            <input class="dropdown-toggle" data-toggle="dropdown" id="hangye"
                                                   readonly="" type="text" value="全部"><span class="caret"></span>
                                            <ul aria-labelledby="dropdownMenu" class="dropdown-menu" id="hangyeList"
                                                role="menu">
                                                <li data=""><a href="#" tabindex="-1">全部</a></li>
                                            </ul>
                                        </div>
                                    </td>
                                    <td>
                                        <label class="control-label">
                                            场景:
                                        </label>
                                        <div class="dropdown-select fl">
                                            <input class="dropdown-toggle" data-toggle="dropdown" id="Cj" readonly=""
                                                   type="text" value="全部"><span class="caret"></span>
                                            <ul aria-labelledby="dropdownMenu" class="dropdown-menu" id="CjList"
                                                role="menu">
                                                <li data=""><a href="#" tabindex="-1">全部</a></li>
                                            </ul>
                                        </div>
                                    </td>
                                </tr>
                                <tr>

                                    <!--<td class="clearfix">-->
                                    <!--<button class="query-btn fl" id="searchBtn" type="button">查询</button>-->
                                    <!--</td>-->
                                </tr>
                                </tbody>
                            </table>
                            <div id="modelList">

                            </div>
                            <div class="dataTables_paginate paging_full_numbers" id="pageD">
                            </div>
                        </div>
                        <div id="myModal" class="modal hide fade" style="display: block;" aria-hidden="true">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal"><span
                                        class="icon12 minia-icon-close"></span></button>
                                <h3>系统提示</h3>
                            </div>
                            <div class="modal-body">
                                <p>确定要删除吗？</p>
                            </div>

                            <div class="modal-footer">
                                <a href="#" class="btn" data-dismiss="modal">取消</a>
                                <a href="#" class="btn btn-danger">确认</a>
                            </div>
                        </div>
                    </div>

                </div><!-- End .box -->

            </div><!-- End .span12 -->

        </div><!-- End .row-fluid -->


    </div><!-- End contentwrapper -->
</div><!-- End #content -->
<div class="span6" id="detail" th:fragment="detail" xmlns:th="http://www.thymeleaf.org"
     style="margin-top: 35px; display: none">

    <div class="box hover">

        <div class="title">

            <h4>
                <span>审核信息</span>
            </h4>

        </div>
        <div class="content">

            <form class="form-horizontal" action="#">

                <div class="form-row row-fluid">
                    <div class="span12">
                        <div class="row-fluid">
                            <label class="form-label span4">模型名称</label>
                            <input class="span8 text" id="name" type="text" readonly>
                        </div>
                    </div>
                </div>

                <div class="form-row row-fluid">
                    <div class="span12">
                        <div class="row-fluid">
                            <label class="form-label span4">创建者</label>
                            <input class="span8 focused text" id="creator" type="text" readonly>
                        </div>
                    </div>
                </div>

                <div class="form-row row-fluid">
                    <div class="span12">
                        <div class="row-fluid">
                            <label class="form-label span4">模型算法</label>
                            <input class="span8 password" id="aiName" type="text" readonly>
                        </div>
                    </div>
                </div>
            </form>

        </div>

    </div><!-- End .box -->

</div>
<div class="" id="onpass" style="margin-top: 35px; display: none;height: 200px;width: 300">

    <div class="box">
        <div class="title">
            <h4>
                <span>不通过原因</span>
            </h4>
        </div>
        <div class="content">
                <div class="form-row row-fluid">
                    <div class="span12">
                        <div class="row-fluid">
                            <textarea class="span8 text" id="noPassMes" type="text"></textarea>
                        </div>
                    </div>
                </div>
        </div>
    </div><!-- End .box -->
</div>

</div><!-- End #wrapper -->

<!-- Le javascript
================================================== -->
<!-- Important plugins put in all pages -->
<script type="text/javascript" th:src="@{/lib/js/jquery.min.js}"></script>
<script type="text/javascript" th:src="@{/lib/js/bootstrap/bootstrap.js}"></script>
<script type="text/javascript" th:src="@{/lib/js/jquery.cookie.js}"></script>
<script type="text/javascript" th:src="@{/lib/js/jquery.mousewheel.js}"></script>

<!-- Charts plugins -->
<script type="text/javascript" src="plugins/charts/sparkline/jquery.sparkline.min.js"
        th:src="@{/lib/plugins/charts/sparkline/jquery.sparkline.min.js}"></script><!-- Sparkline plugin -->

<!-- Misc plugins -->
<script type="text/javascript" th:src="@{/lib/plugins/misc/qtip/jquery.qtip.min.js}"></script>
<!-- Custom tooltip plugin -->
<script type="text/javascript" th:src="@{/lib/plugins/misc/totop/jquery.ui.totop.min.js}"></script>

<!-- Search plugin -->
<script type="text/javascript" th:src="@{/lib/plugins/misc/search/tipuesearch_set.js}"></script>
<script type="text/javascript" th:src="@{/lib/plugins/misc/search/tipuesearch_data.js}"></script>
<!-- JSON for searched results -->
<script type="text/javascript" th:src="@{/lib/plugins/misc/search/tipuesearch.js}"></script>

<!-- Form plugins -->
<script type="text/javascript" th:src="@{/lib/plugins/forms/watermark/jquery.watermark.min.js}"></script>
<script type="text/javascript" th:src="@{/lib/plugins/forms/uniform/jquery.uniform.min.js}"></script>

<!-- Fix plugins -->
<script type="text/javascript" th:src="@{/lib/plugins/fix/ios-fix/ios-orientationchange-fix.js}"></script>

<!-- Table plugins -->
<script type="text/javascript" th:src="@{/lib/plugins/tables/dataTables/jquery.dataTables.min.js}"></script>
<script type="text/javascript" th:src="@{/lib/plugins/tables/responsive-tables/responsive-tables.js}"></script>
<!-- Make tables responsive -->

<!-- Important Place before main.js  -->
<script type="text/javascript" th:src="@{/lib/js/jquery-ui.min.js}"></script>
<script type="text/javascript" th:src="@{/lib/plugins/fix/touch-punch/jquery.ui.touch-punch.min.js}"></script>
<!-- Unable touch for JQueryUI -->

<!-- Init plugins -->
<script type="text/javascript" th:src="@{/lib/js/main.js}"></script><!-- Core js functions -->
<script type="text/javascript" th:src="@{/lib/js/datatable.js}"></script><!-- Init plugins only for page -->
<script type="text/javascript" src="../../static/lib/js/commonAjax.js" th:src="@{/lib/js/commonAjax.js}"></script>

<!-- layer -->
<script type="text/javascript" th:src="@{/lib/layer/layer.js}"></script><!-- Core js functions -->
<script type="text/javascript" th:src="@{/lib/layPage/laypage.js}"></script><!-- Init plugins only for page -->
<script src="../../static/js/model/modelList.js" th:src="@{/js/model/modelList.js}"></script>


<script th:inline="javascript">
    new modelList();
    //    $("#submitQuery").click(function () {
    //        $("#searchForm").submit();
    //    });
    //初始化下拉框
    var hangye = [[${industys}]];
    var hangyeTemp = "";
    for (var i = 0; i < hangye.length; i++) {
        hangyeTemp += '<li data="' + hangye[i].id + '"><a href="#" tabindex="-1">' + hangye[i].industryName + '</a></li>';
    }
    $("#hangyeList").append(hangyeTemp);
    var Cj = [[${scenes}]];
    var CjListTemp = "";
    for (var i = 0; i < Cj.length; i++) {
        CjListTemp += '<li data="' + Cj[i].id + '"><a href="#" tabindex="-1">' + Cj[i].sceneName + '</a></li>';
    }
    $("#CjList").append(CjListTemp);
    function edite(btn, action) {
        var content = $(btn).attr("value");
        // 创建Form
        var form = $("<form></form>");
        $(document.body).append(form);
        // 设置属性
        form.attr('action', action);
        form.attr('method', 'get');
        form.attr('target', '_self');
//         创建Input
        var my_input = $('<input type="text" name="modelId" />');
        my_input.attr('value', content);
        // 附加到Form
        form.append(my_input);
        // 提交表单
        form.submit();
        // 注意return false取消链接的默认动作
        return false;
    }
    function upAdown(a) {
        var status = $(a).attr("value");
        var modelId = $(a).find("input").val();
        doUpAdown(status,modelId);
    }
    function doUpAdown(status,modelId,noPassMes) {
        var url = '/modelController/upAdown.do', isAdd = false;
        getHtmlByUrl({
            url: url,
            data: {status: status, modelId: modelId,noPassMes:noPassMes},
            success: function (res) {
                layer.msg(res.message);
                location.reload();
            }
        });
    }
    function examine(a) {
        var modelId = $(a).find("input").val();

        var url = '/modelController/modelExamineInfo.do';
        getHtmlByUrl({
            url: url,
            data: {modelId: modelId},
            success: function (res) {
                if (res.code = "000000") {
                    var res = res.result;
                    $("#name").val(res.model_name);
                    $("#creator").val(res.username);
                    $("#aiName").val(res.aiName);
                    layer.open({
                        type: 1,
                        title: '',
                        btn: ['不通过', '通过'],
                        area: ['620px', '440px'],
                        content: $('#detail'),
                        btn1: function () {
                            layer.open({
                                type: 1,
                                title: '',
                                btn: ['提交', '取消'],
                                area: ['400px', '300px'],
                                content: $('#onpass'),
                                btn1: function (index) {
                                    doUpAdown('10006',modelId,$("#noPassMes").val());
                                }
                            });
                        },
                        btn2: function (index) {
                            doUpAdown('10003',modelId);
                        }
                    });
                } else {
                    layer.msg(未知异常);
                }

            }
        });
    }
</script>

</body>
</html>
